﻿using System;
using System.ServiceModel;
using RrslLite.Net.Attributes;
using RrslLite.Net.Messages;
using RrslLite.Net.Proxies;

namespace RrslLite.Net.Contracts
{
    [ServiceContract(Name = "IWcfMessageService", ConfigurationName = "RrslLite.Net.Contracts.IWcfMessageService")]
    public interface IAsyncWcfMessageService : IDisposable
    {

        [OperationContract(AsyncPattern = true, Name = "InvokeOperations")]
        [ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
        IAsyncResult BeginInvokeOperations(Message[] messages, AsyncCallback callback, object asyncState);

        Message[] EndInvokeOperations(System.IAsyncResult result);

        void InvokeOperationsAsync(Message[] messages, Action<InvokeOperationsAsyncCompletedArgs> operationsCompleted);
    }
}
